#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int
main(int argc, char *argv[])
{
	int x;
	x = 100;
	printf("hello world (pid:%d)\n", (int)getpid());
	int rc =fork();
	if(rc < 0){
		fprintf(stderr, "fork failed\n");
		exit(1);
	}else if(rc == 0){
		x = 107;
		printf("hello, I am child (x:%d) (pid:%d)\n", x, (int)getpid());
	}else{
		//int wc = wait(NULL);
		//x = 103;
		printf("hello, I am parent of %d (x:%d) (pid:%d)\n", rc, x, (int)getpid());
	}

	return 0;
}
